<div class="profile">
<h2><?php  __('Kullanıcı Bilgileri');?></h2>
<div class="userinfo">
	<div><?php __('Kullanici Adi: '); ?>
	<?php echo $user['username']; ?>
	</div><dıv>			
	<?php __('Adi: '); ?>
	<?php echo $user['fname']; ?>
	</dıv><div>
	<?php __('Soyadi: '); ?>
	<?php echo $user['lname']; ?>
	</div><div>
	<?php __('Doğum Tarihi: '); ?>
	<?php echo $user['bdate']; ?>
	</div><div>
	<?php __('Email: '); ?>
	<?php echo $user['email']; ?>
	</div><div>
	<?php __('Gsm: '); ?>
	<?php echo $user['gsm']; ?>
	</div><div>
	<?php __('Adres: '); ?>
	<?php echo $user['address']; ?>
	</div>
	<a href="/bookstore/users/profileupdate/<?php echo $user['id']?>" class="button"><span class='pen icon'></span>Profilimi Güncelle</a>
	<a href="/bookstore/users/changepassword/<?php echo $user['id']?>" class="button"><span class='key icon'></span>Şifre Değiştir</a>
</div>
<div class="usersales">
	<h3><?php __('Satın Almış Olduğunuz Ürünler');?></h3>
	<?php if (!empty($sale)):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Ürün Adı'); ?></th>
		<th><?php __('Ürün Resmi'); ?></th>
		<th><?php __('Ürün Türü'); ?></th>
		<th><?php __('Fiyatı'); ?></th>
		<th><?php __('Satın Alma Tarihi'); ?></th>
		
	</tr>
	<?php
		$i = 0;
		foreach ($sale as $satis):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $satis['Product']['name'];?></td>
			<td><?php echo $this->Html->image($satis['Product']['image'],array('alt'=>$satis['Product']['name'],'class'=>'urunresim')); ?>&nbsp;</td>
			<td><?php echo $satis['Product']['category'];?></td>
			<td><?php echo $satis['Product']['price'];?></td>
			<td><?php echo $this->Time->format($format = 'd.m.Y H:i', $satis['Sale']['created']);?></td>
			
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

</div>
<div class="userscores">
	<h3><?php __('Vermiş Olduğunuz Ürün Puanları');?></h3>
	<?php if (!empty($score)):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Ürün İsmi'); ?></th>
		<th><?php __('Ürün Resmi'); ?></th>
		<th><?php __('Ürün Türü'); ?></th>
		<th><?php __('Puan'); ?></th>
		<th><?php __('Tarih'); ?></th>
		
	</tr>
	<?php
		$i = 0;
		foreach ($score as $puan):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $puan['Product']['name'];?></td>
			<td><?php echo $this->Html->image($puan['Product']['image'],array('alt'=>$puan['Product']['name'],'class'=>'urunresim')); ?>&nbsp;</td>
			<td><?php echo $puan['Product']['category'];?></td>
			<td><?php echo $puan['Score']['score'];?></td>
			<td><?php echo $this->Time->format($format = 'd.m.Y H:i', $puan['Score']['created']);?></td>
			
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
</div>
<div class="related comment_container" id="comment_container">
<div id="comments">
<h3>Yapmış Olduğunuz Yorumlar:</h3>
<?php foreach ($comment as $yorum): ?>
<div class="commentbox">
<?php echo $yorum['Comment']['comment'];?>
</div>
<div class="commentfooter"><?php echo $yorum['Product']['name'].", ".$this->Time->format($format = 'd.m.Y H:i', $yorum['Comment']['created']); ?></div>
<?php endforeach; ?>
</div>
</div>
</div>